package com.sky.city.widget;

import android.content.Context;
import android.graphics.Color;
import android.graphics.drawable.GradientDrawable;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.sky.city.R;

import butterknife.BindView;
import butterknife.ButterKnife;

public class BaseCircleView extends RelativeLayout {

    @BindView(R.id.tv_circle)
    TextView tv_circle;
    private GradientDrawable myShapeDrawable;

    public BaseCircleView(Context context) {
        this(context, null);
    }

    public BaseCircleView(Context context, AttributeSet attrs) {
        this(context, attrs, 0);
    }

    public BaseCircleView(Context context, AttributeSet attrs, int defStyleAttr) {
        this(context, attrs, defStyleAttr, 0);
    }

    public BaseCircleView(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
        super(context, attrs, defStyleAttr, defStyleRes);
        View view = LayoutInflater.from(context).inflate(R.layout.widget_circle_layout, null);
        addView(view);
        ButterKnife.bind(this, this);
        myShapeDrawable = (GradientDrawable) tv_circle.getBackground();
    }


    public void setColor(int color){
        myShapeDrawable.setColor(color);
    }

}
